package sctu.edu.java.year2016.team05.zengkun.day20160605;

import sctu.edu.java.year2016.team05.zengkun.day20160605.exercise.Example_08;

import java.io.FileReader;
import java.io.IOException;

/**
 * Created by mike on 2016/6/5.
 */
public class Exercise0 {
    private FileReader read = null;

    public void createrFile() throws Exception {
        read = new FileReader("C:\\Users\\12903\\Desktop\\dev\\sctu-java-2016\\src\\main\\java\\sctu\\" +
                "edu\\java\\year2016\\team05\\zengkun\\day20160605\\Exercise0.java");
        System.out.println("分配内存资源：");
    }

    public void test() {
        try {
            createrFile();

        } catch (Exception ex) {
            ex.printStackTrace();
            System.out.println("创建IO对象异常");

        } finally {
            if (read != null) {
                try {
                    read.close();
                    System.out.println("释放内存资源：");

                } catch (IOException e) {

                    e.printStackTrace();
                    System.out.println("关闭IO对象异常。");


                }
            }
        }
    }

    public static void main(String[] args) {
        Exercise0 ex =new Exercise0();
        ex.test();
    }


}